package org.jeecg.modules.factor.service.impl;


import org.jeecg.modules.api.entity.CyEmissionUnitConvert;
import org.jeecg.modules.factor.mapper.CyEmissionUnitConvertMapper;
import org.jeecg.modules.factor.service.ICyEmissionUnitConvertService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import java.util.List;

/**
 * @Description: 碳排因子单位转换
 * @Author: jeecg-boot
 * @Date:   2024-11-01
 * @Version: V1.0
 */
@Service
public class CyEmissionUnitConvertServiceImpl extends ServiceImpl<CyEmissionUnitConvertMapper, CyEmissionUnitConvert> implements ICyEmissionUnitConvertService {

    @Autowired
    private CyEmissionUnitConvertMapper cyEmissionUnitConvertMapper;

    @Override
    public void deleteByUnitId(String unitId) {
        cyEmissionUnitConvertMapper.deleteByUnitId(unitId);
    }
    @Override
    public List<CyEmissionUnitConvert> selectByUnitId(String unitId) {
        List<CyEmissionUnitConvert> cyEmissionUnitConverts = cyEmissionUnitConvertMapper.selectByUnitId(unitId);
        return cyEmissionUnitConverts;
    }

    @Override
    public Double getConvertValue(String sourceUnit, String targetUnit) {
        Double convertValue = cyEmissionUnitConvertMapper.getConvertValue(sourceUnit, targetUnit);
        return convertValue;
    }
}
